package com.second.app.thread.notifydemo;

/**
 * @Author soul gao
 * @Date 2021/1/24 12:12
 * 努力学习 天天进步
 */
public class Run {
    public static void main(String[] args) {
        try {
            Object lock = new Object();
            ThreadA threadA = new ThreadA(lock);
            threadA.setName("线程A");
            ThreadB threadB = new ThreadB(lock);
            threadB.setName("线程B");
            threadA.start();
            Thread.sleep(3000);
            threadB.start();
            NotifyThread notifyThread = new NotifyThread(lock);
            notifyThread.setName("唤醒线程");
            notifyThread.start();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
